<?php

// +----------------------------------------------------
// | Name: 星空框架  用户验证规则
// +----------------------------------------------------
// | Version: V5.0
// +----------------------------------------------------
// | Author: xkyinzhe <zhonghuaxinxing@sina.cn>
// +----------------------------------------------------
// | Time： 2021-05-07 13：01
// +----------------------------------------------------
declare(strict_types=1);

namespace app\common\validate;

use app\common\model\User as UserModel;

use think\Validate;

/**
 * @xk 用户验证模型
 */
class UserLevel extends Validate
{
    protected $rule = [
    'user_level_id' => 'require|number',
    'level_name' => 'require',
    'picurl' => 'require',
    'buy_num' => 'require|number|between:0,9999999999999999',
    'team_achievement_price' => 'require|float|between:0,9999999999999999.99',
    'child_num' => 'require|number|between:0,9999999999999999',
  ];
    protected $message = [
    'user_level_id' => '等级id不能小于0',
    'level_name' => '请填写等级名称',
    'picurl' => '请上传等级图片',
    'buy_num' => '请输入升级需要的购买数量',
    'team_achievement_price' => '请输入升级需要的团队累计业绩',
    'child_num' => '请输入升级需要的下个等级数量',
  ];
  protected $scene = [
    'create' => ['level_name','picurl','buy_num','team_achievement_price','child_num'],
    'edit' => ['user_level_id','level_name','picurl','buy_num','team_achievement_price','child_num'],
  ];
}
